const app=getApp()

/**
 * import hasPermission from "../../utils/auth.js"
 * console.log(hasPermission("add_customer"))
 * 是否有权限
 */
const hasPermission=permission=>{
  let user = app.globalData.userInfo
  console.log('user',user)
  let index = user.permission.findIndex(item=>{
    return item.name==permission
  })
  if(index!=-1){
    return true
  }else{
    return false
  }
}
export default hasPermission